package com.tiancheng.trade.settlement.mapper.settlement;

import com.tiancheng.trade.settlement.mapper.TYBaseMapper;
import com.tiancheng.trade.settlement.model.settlement.SettlementRule;
import com.tiancheng.trade.settlement.vo.settlement.api.OpenDeleteRuleVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SettlementRuleMapper extends TYBaseMapper<SettlementRule> {

    /**
     * 定时任务批量修改清分规则生效/失效状态
     *
     * @param status
     * @param strList
     * @return
     */
    int updateRuleStatus(String status, List<Long> strList);

    /**
     * 查询清分规则信息-按商户编号批量查询
     *
     * @param listStr
     * @return
     */
    List<SettlementRule> getSettlementRuleByMerCode(@Param("list") List<String> listStr);

    /**
     * 查询清分规则信息-按商户编号和产品编号批量查询
     *
     * @param merStr
     * @param proStr
     * @return
     */
    List<SettlementRule> getSettlementRuleByMerProCode(@Param("merList") List<String> merStr, @Param("proList") List<String> proStr, @Param("date") String date);

    /**
     * 作废清分规则，根据商户编码+商品编码
     *
     * @param products
     */
    void deleteOpenBatch(@Param("list") List<OpenDeleteRuleVO.Product> products);
}
